//
//  LaughTabBarController.m
//  SmileWeather
//
//  Created by lanou3g on 15/9/16.
//  Copyright (c) 2015年 陶天海. All rights reserved.
//

#import "LaughTabBarController.h"

@interface LaughTabBarController ()

@end

@implementation LaughTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
  LatestJokeViewController *jokesVC = [[LatestJokeViewController alloc] init];
    MoreJokesViewController *moreJokesVC = [[MoreJokesViewController alloc] init];
    LatestFunPicsViewController *funPicsVC = [[LatestFunPicsViewController alloc] init];
    MoreFunPicsViewController *moreFunPicsVC = [[MoreFunPicsViewController alloc] init];
    [self addChildVC:jokesVC title:@"最新笑话" imageName:@"11" selectedImage:@""];
    
    [self addChildVC:moreJokesVC title:@"更多笑话" imageName:@"22" selectedImage:@""];
    [self addChildVC:funPicsVC title:@"最新趣图" imageName:@"33" selectedImage:@""];
    [self addChildVC:moreFunPicsVC title:@"更多趣图" imageName:@"44" selectedImage:@""];
    // Do any additional setup after loading the view.
}


- (void)addChildVC:(UIViewController *)childVc title:(NSString *)title imageName:(NSString *)imageName selectedImage:(NSString *)selectedImage
{
    childVc.tabBarItem.image = [UIImage imageNamed:imageName];
    // 设置选中图标
    childVc.tabBarItem.selectedImage = [UIImage imageNamed:selectedImage];
    //imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    //设置导航控制器
    UINavigationController *childNVC = [[UINavigationController alloc] initWithRootViewController:childVc];
    
    
    childVc.navigationItem.title = title;
    childNVC.tabBarItem.title = title;
    //将我们设置好的视图控制器添加至TabBarController
    
    [self addChildViewController:childNVC];
    
    
    
    
    
    
    
    
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
